package edu.java.texbooks.scjp.collections.test07.set;

import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;

import edu.java.texbooks.scjp.collections.test07.set.student.Student;

public class TestLinkedHashSet {
	static Student student1 = new Student("Pesho Ivanov", 56214, 5.34);
	static Student student2 = new Student("Asen Ivanov", 56378, 5.12);

	static Student student3 = new Student("Petq Milcheva", 46214, 3.34);
	static Student student4 = new Student("Asq Ivanova", 67378, 4.12);
	static Student student5 = new Student("Lora Vasileva", 54623, 5.80);

	public static void main(String[] args) {

		test01();
		
	}

	public static void test01() {
		Set<Student> lhss = new LinkedHashSet<Student>();

		System.out.println("\n" + "size: " + lhss.size());
		System.out.println("Is empty: " + lhss.isEmpty());

		boolean[] boolArray = new boolean[7];
		boolArray[0] = lhss.add(student1);
		boolArray[1] = lhss.add(student2);
		boolArray[2] = lhss.add(student3);
		boolArray[3] = lhss.add(student2);
		boolArray[4] = lhss.add(student3);
		boolArray[5] = lhss.add(student4);
		boolArray[6] = lhss.add(null);
		
		System.out.println("\n" + "size: " + lhss.size());
		System.out.println("Contains null --> " + lhss.contains(null));
		System.out.println("\n" + Arrays.toString(boolArray));
		System.out.println("\n------ Print Linked HashSet --------------\n");
		System.out.println(lhss.toString());
		
		
		
		
	}
}
